package cn.itcast.blog.service;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import cn.itcast.blog.Utils.ServiceProxyUtils;
import cn.itcast.blog.Utils.SessionFactoryUtils;
import cn.itcast.blog.domain.Category;
import cn.itcast.blog.mapper.CategoryMapper;

public class CategoryService implements CategoryMapper{
	
	CategoryMapper mapper;
	
	//查询所有的分类
	@Override
	public List<Category> findByAll() {
		
		List<Category> findByAll = mapper.findByAll();
		
		return findByAll;
	}
	
	//添加分类
	@Override
	public void insertCategory(Category category) {
		
		mapper.insertCategory(category);
		
	}

	@Override
	public void updateCategory(Category category) {
		
		mapper.updateCategory(category);
		
	}

	@Override
	public void deleteCategory(Integer id) {
		
		mapper.deleteCategory(id);
		
	}
}
